package cn.wolfcode.trip.base.domain;

import com.alibaba.fastjson.JSON;
import lombok.*;

import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class HotelDictionaryItem extends BaseDomain {

    private Long region_id;

    private Long parentId;

    private String title;

    private Integer sequence;

    private Region place;

    public String getJson(){
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("parentId",parentId);
        map.put("title",title);
        map.put("sequence",sequence);
        if (place != null) {
            map.put("placeId",place.getId());
            map.put("placeName",place.getName());
        }


        return JSON.toJSONString(map);
    }




}